<html><head><title>Formulas and Values as CSV File</title><meta name="filename" content="text/scalc/guide/csv_formula"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
p.P1{
}
p.P2{
}
p.P3{
}
span.T1{
font-weight:bold;}
</style></head><body>
<p class="P1"/>
<p class="Head1"><help:key-word value="csv files" tag="kw68161_1" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="formulas; saving as csv files" tag="kw68161_6" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="exporting; tables as text" tag="kw68161_5" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="importing; tables as text" tag="kw68161_4" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="tables; exporting as text" tag="kw68161_3" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="tables; importing as text" tag="kw68161_2" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="csv_formula" xmlns:help="http://openoffice.org/2000/help"><help:link Id="68161">Formulas and Values as CSV File</help:link></help:to-be-embedded></p>
<p class="Paragraph">Csv-files are pure text files, which contain the contents of the cells of a table. Commas or semicolons, for example, are used as the field delimiters between the cells. Texts are automatically put in quotation marks, numbers are written directly.</p>
<p class="Head2">Exporting Formulas and Values as CSV Files</p>
<ol class="L1">
<li class="">
<p class="P2">Go to the table that is to be written as a csv file.</p>
</li>
<li class="">
<p class="P2">If you want to export the formulas as formulas, e.g. in the form =SUM(A1:B5), proceed as follows:</p>
<p class="P2">Under <span class="T1">Display</span>, mark the <span class="T1">Formulas</span> field. Click OK.</p>
<p class="P2">If instead of the formulas you want to export the calculation results, do not mark <span class="T1">Formulas</span>.</p>
</li>
<li class="">
<p class="P2">Choose <span class="T1">File - Save as</span>. You will see the <span class="T1">Save as</span> dialog .</p>
</li>
<li class="">
<p class="P2">In the <span class="T1">File type</span> field select the format "Text CSV".</p>
</li>
<li class="">
<p class="P2">Enter a name and click <span class="T1">Save</span>.</p>
</li>
<li class="">
<p class="P2">From the <span class="T1">Export Text</span> dialog that appears, select the records and the field and text delimiters for the data to be exported and confirm with OK.</p>
<p class="P2">Caution: If the numbers contain commas as the decimal separator or thousands separator, you should not select the comma as the field delimiter. If the text contains double quotation marks, you must select the single quotation mark as separator and vice versa.</p>
</li>
<li class="">
<p class="P2">If necessary, after you have saved, unmark <span class="T1">Formulas</span> to see the calculated results in the table again.</p>
</li>
</ol>
<p class="Head2">Importing a CSV File</p>
<ol class="L2">
<li class="">
<p class="P3">Choose <span class="T1">File - Open</span>. You will see the <span class="T1">Open</span> dialog .</p>
</li>
<li class="">
<p class="P3">In the <span class="T1">File type</span> field, select the format "Text CSV". Select the file and click <span class="T1">Open</span>. When a file has the .csv extension, the file type is automatically recognized.</p>
</li>
<li class="">
<p class="P3">You will see the <span class="T1">Import text files</span> dialog. Click OK.</p>
</li>
<li class="">
<p class="P3">If the csv file contains formulas as formulas, unmark <span class="T1">Formulas</span> <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>(in <span class="T1">Tools - Options - Spreadsheet - View</span>), so that you see the calculated results in the table.</p>